package com.hd.core.project.module.async;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 邮件异步操作类
 * 
 * <br/>
 * @since JDK 1.8
 * @version  V1.0
 * @author RichardTang 
 * @date: 2018年9月7日
 * @package com.hd.core.project.module.async
 * @copyright:Copyright (c) 2018, 1245811923@qq.com All Rights Reserved.
 */
@Component
public class MailAsync {

	@Autowired
	private JavaMailSender javaMailSender;
	
	/**
	 * 异步发送邮件
	 */
	@Async
	public void sendMail(SimpleMailMessage message) {
		javaMailSender.send(message);
	}
	
}
